<template>
	<view>

		<u-notice-bar mode="vertical" :list="notice"></u-notice-bar>
		<u-top-tips ref="uTips"></u-top-tips>
		<view style="padding-left: 30rpx; padding-right: 30rpx">
			<view style="padding-top: 20rpx;">
				<u-search placeholder="同学/动态/活动等"  @search="search" @custom="search" v-model="s_keyword"></u-search>
				<u-modal v-model="sm_show" :content="sm_content"></u-modal>
			
			</view>
			<view style="padding-top: 20rpx;">
				<u-swiper :list="list"></u-swiper>
			</view>
			<view style="padding-top: 20rpx;">
				
				<u-grid :col="5" @click="gridclick">
					<u-grid-item :index="0">
						<image class="grid-b-icon" src="../../static/b-class.png">
						<view class="grid-text">我的班级</view>
					</u-grid-item>
					<u-grid-item :index="1">
						<image class="grid-b-icon" src="../../static/b-users.png">
						<view class="grid-text">同学们</view>
					</u-grid-item>
					<u-grid-item :index="2">
						<image class="grid-b-icon" src="../../static/b-photo.png">
						<view class="grid-text">图片墙</view>
					</u-grid-item>
					<u-grid-item :index="3">
						<image class="grid-b-icon" src="../../static/b-admin.png">
						<view class="grid-text">班级管理</view>
					</u-grid-item>
					<u-grid-item :index="4">
						<image class="grid-b-icon" src="../../static/b-tab.png">
						<view class="grid-text">我的消息</view>
					</u-grid-item>
				</u-grid>
			</view>
			<u-gap height="16" bg-color="white"></u-gap>
			<view class="kuai">
				<text class="kuai_title">班级公告</text>
				<u-line color="blue" length="144rpx"/>
				<u-gap height="16" bg-color="white"></u-gap>
				<text style="line-height: 1.5;">    同学们，我们周六聚会，不见不散吖！！！ 地点在万达广场，一定准时到场哈！</text>
			</view>
			<view class="kuai">
				<text class="kuai_title">系统公告</text>
				<u-line color="blue" length="144rpx"/>
				<u-gap height="16" bg-color="white"></u-gap>
				<text style="line-height: 1.5;">    明日系统更新，暂时停用，敬请谅解。</text>
			</view>
		</view>
	</view>
		
</template>


<script>

	export default {
		
		
		data() {
			return {
				s_keyword: '',
				sm_show: false,
				sm_content: '不断',
				notice:[
					"不断云班系统即将上线，敬请期待",
					"点击动态页第一条图文加入测试钉钉群",
					"目前为测试预览版本"
				],
				list: [
					{
						image: 'https://s1.ax1x.com/2020/10/30/BNJWPx.jpg',
					}
				]
			}
		},
		onLoad() {
			uni.getStorage({
				key:'bcc_token',
				fail: (Info) => {
					uni.reLaunch({
						url:"../nokey/nokey",
					})
				},
				success:(Info) => {
					console.log(Info.data)
				}
			})
			/*
			try {
			    const value = uni.getStorageSync('token');
			    if (value) {
			        uni.showModal({
						title:'token',
						content:value
					})
			    }
			} catch (e) {
			    // error
				uni.reLaunch({
					url:"..,
				})
			}
			*/
			
		},
		
		methods: {
			search (value) {
				uni.navigateTo({
					url:'search?con=' + value,
					success: this.$refs.uTips.show({
						title: 'search:' + value + ' navigate跳转成功！',
						type: 'success',
						duration: '3000'
					}),

				})
				},
			gridclick (index) {
				if (index == 0){
					uni.switchTab({
						url:'../my/classes'
					})
				}else
				if (index == 1){
					uni.switchTab({
						url:'../my/classmates'
					})
				}else
				if (index == 2){
					uni.showModal({
						title:'暂未开放',
						content:'因服务器承压问题，暂不开放该功能'
					})
				}else
				if (index == 3){
					uni.showModal({
						title:'开发中',
						content:'未开发完成'
					})
				}else
				if (index == 4){
					uni.navigateTo({
						url:'../my/index'
					})
				}
			}
			
		},
		
	}
	
</script>

<style>
	.grid-b-icon {
		width: 80rpx;
		height: 80rpx;
	}
	.wrap {
		padding: 40rpx;
	}

	.logo {
		height: 200rpx;
		width: 200rpx;
		margin-top: 200rpx;
		margin-left: auto;
		margin-right: auto;
		margin-bottom: 50rpx;
	}
	
	.grid-text {
			font-size: 20rpx;
			margin-top: 4rpx;
			color: $u-type-info;
		}
		
	.text-area {
		display: flex;
		justify-content: center;
	}

	.title {
		font-size: 36rpx;
		color: #8f8f94;
	}
	.kuai_title {
		font-size: 36rpx;
		font-weight: 900;
	}
	.kuai{
		padding-top: 16rpx;
		padding-bottom: 64rpx;
	}
</style>
